#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define NUM 51

int main()
{
    char bar[NUM];
    memset(bar,0,sizeof(bar));
    const char *lable="|/-\\";
    int i=0;
    while(i<=50)
    {
        printf("[%-50s][%d%%] %c\r",bar,i*2,lable[i%4]);
        bar[i++]='#';
        fflush(stdout);
        usleep(30000);
    }
    printf("\n");
    return 0;
}
